﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            //Console.WriteLine("老虎");
            //Tiger t = new Tiger();
            //t.Leg = 4;
            //t.Walk();
            //t.Eat();
            //t.Cry();
            //t.Run();
            //t.NightSee();
            //t.KindTiger();
            //Console.WriteLine("--------------");
            //Console.WriteLine("猫");
            //Cat c = new Cat();
            //c.Leg = 4;
            //c.Walk();
            //c.Eat();
            //c.Cry();
            //c.Run();
            //c.NightSee();
            //c.CatchMouse();
            //Console.WriteLine("--------------");
            //Console.WriteLine("鹰");
            //Eagle e = new Eagle();
            //e.Leg = 2;
            //e.Walk();
            //e.Eat();
            //e.Cry();
            //e.Run();
            //e.Fly();
            //e.CatchChicken();
            //Console.WriteLine("--------------");
            //Console.WriteLine("燕子");
            //Swallow s = new Swallow();
            //s.Leg = 2;
            //s.Walk();
            //s.Eat();
            //s.Cry();
            //s.Run();
            //s.Fly();
            //s.SwallowNest();

            //宠物寄存
            Petstore ps = new Petstore();
            Cat c = new Cat();
            ps.ConsignCat(c);
            Console.WriteLine("***********");
            Tiger t = new Tiger();
            ps.ConsignTiger(t);
            Console.WriteLine("***********");
            Eagle e = new Eagle();
            ps.ConsignEagle(e);
            Console.WriteLine("***********");
            Swallow s = new Swallow();
            ps.ConsignSwallow(s);
            //实现多态的条件：1.继承；2.重写；3.父类的引用指向子类的实例。
            Animal a = new Cat();
        }
    }
}
